package TimeDate;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Test02 {
    public static void main(String[] args) throws ParseException {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入第一个生日：");
        String birthdayOne = scanner.next();
        System.out.println("请输入第二个生日：");
        String birthdayTwo = scanner.next();

        Date date = new Date();
        SimpleDateFormat birthday = new SimpleDateFormat("yyyy年MM月dd日");

        Date parse = birthday.parse(birthdayOne);
        Date parse1 = birthday.parse(birthdayTwo);

        if (parse.getTime() > parse1.getTime()) {
            System.out.println("第一个生日年龄比较小");
        } else if (parse.getTime() < parse1.getTime()) {
            System.out.println("第二个生日年龄比较小");
        } else {
            System.out.println("一样大");
        }
    }
}
